package aybolit.core.objects.model;

import javax.persistence.Entity;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by IntelliJ IDEA.
 * User: Vadim
 * Date: 29.03.13
 * Time: 16:54
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "healing_symptoms", schema = "", catalog = "aybolit")
@Entity
public class HealingSymptoms implements Serializable {
    private int healingSymptomId;

    @javax.persistence.Column(name = "healing_symptom_id")
    @javax.persistence.Id
    public int getHealingSymptomId() {
        return healingSymptomId;
    }

    public void setHealingSymptomId(int healingSymptomId) {
        this.healingSymptomId = healingSymptomId;
    }

    private int symptomId;

    @javax.persistence.Column(name = "symptom_id")
    @javax.persistence.Basic
    public int getSymptomId() {
        return symptomId;
    }

    public void setSymptomId(int symptomId) {
        this.symptomId = symptomId;
    }

    private String value;

    @javax.persistence.Column(name = "value")
    @javax.persistence.Basic
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    private Timestamp timestamp;

    @javax.persistence.Column(name = "timestamp_")
    @javax.persistence.Basic
    public Timestamp getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Timestamp timestamp) {
        this.timestamp = timestamp;
    }

    private int status;

    @javax.persistence.Column(name = "status")
    @javax.persistence.Basic
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    private int healingId;

    @javax.persistence.Column(name = "healing_id")
    @javax.persistence.Basic
    public int getHealingId() {
        return healingId;
    }

    public void setHealingId(int healingId) {
        this.healingId = healingId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        HealingSymptoms that = (HealingSymptoms) o;

        if (healingId != that.healingId) return false;
        if (healingSymptomId != that.healingSymptomId) return false;
        if (status != that.status) return false;
        if (symptomId != that.symptomId) return false;
        if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) return false;
        if (value != null ? !value.equals(that.value) : that.value != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = healingSymptomId;
        result = 31 * result + symptomId;
        result = 31 * result + (value != null ? value.hashCode() : 0);
        result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
        result = 31 * result + status;
        result = 31 * result + healingId;
        return result;
    }

    private Healing healingByHealingId;

    @javax.persistence.ManyToOne
    public
    @javax.persistence.JoinColumn(name = "healing_id", referencedColumnName = "healing_id")
    Healing getHealingByHealingId() {
        return healingByHealingId;
    }

    public void setHealingByHealingId(Healing healingByHealingId) {
        this.healingByHealingId = healingByHealingId;
    }

    private Symptoms symptomsBySymptomId;

    @javax.persistence.ManyToOne
    public
    @javax.persistence.JoinColumn(name = "symptom_id", referencedColumnName = "symptom_id")
    Symptoms getSymptomsBySymptomId() {
        return symptomsBySymptomId;
    }

    public void setSymptomsBySymptomId(Symptoms symptomsBySymptomId) {
        this.symptomsBySymptomId = symptomsBySymptomId;
    }
}
